import React, { FC, useMemo } from 'react';
import { View, Text, Image } from '@tarojs/components';
import { styled } from 'linaria/react';
import { useClassName } from '@/utils/index';
export interface IProps extends ICompProps {
    isChecked:boolean,
}
CheckBox.defaultProps = {} as Partial<IProps>;
function CheckBox(props: IProps) {
    const { className, style, isChecked } = props;
    const localClassName = useClassName('CheckBox', className);
    const localStyle = useMemo(() => {
        return {
            ...style,
            backgroundColor:isChecked?'#ff8828':'#fff',
        };
    }, [style, isChecked]);
    return (
        <RootView className={localClassName} style={localStyle}>
            <Image className="img" src={require('@/assets/images/selection-gou.png')} mode="scaleToFill" />
        </RootView>
    );
}
export default React.memo(CheckBox as FC<IProps>);
const cssBorder = ` 1px solid #cbcdd6`;
const RootView = styled(View)`
    &.CheckBox {
        width: 40px;
        height: 40px;
        line-height: 40px;
        text-align: center;
        color: #fff;
        border: ${cssBorder};
        border-radius: 50%;
    }
`;
